<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Drag-and-Drop Sorting</title>
  <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.5.6/css/layui.css">
  <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/jqueryui/1.12.1/jquery-ui.min.js"></script>
  <script src="https://cdn.staticfile.org/layui/2.5.6/layui.js"></script>
  <style>
    .event-container {
      width: 45%;
      padding: 10px;
      margin: 10px;
      border: 1px solid #ccc;
      display: inline-block;
    }
  </style>
</head>

<body>
  <div class="event-container" id="event1">Event 1</div>
  <div class="event-container" id="event2">Event 2</div>
  <div class="event-container" id="event3">Event 3</div>
  <div class="event-container" id="event4">Event 4</div>

  <script>
    $(function () {
      $(".event-container").sortable({
        connectWith: ".event-container",
        placeholder: "ui-state-highlight",
        update: function (event, ui) {
          // Logic to handle sorting order
          // You can update the order of events here
        }
      }).disableSelection();
    });
  </script>
</body>

</html>